const menuList = [
    {
        name: "大屏数据",
        code: "bigscreenData",
        toPath: "/bigscreenData",
        icon: "",
    },
    {
        name: "生产数据",
        code: "waterYield",
        toPath: "/waterYield",
        icon: "",
    },
    { name: "化验数据", code: "assay", toPath: "/assay", icon: "" },
    { name: "数据审核", code: "examine", toPath: "/examine", icon: "" },
    { name: "设备管理", code: "equipment", toPath: "/equipment", icon: "" },
    {
        name: "排班巡检",
        code: "schedulePatrol",
        toPath: "/schedulePatrol",
        icon: "",
    },
    {
        name: "用户管理",
        code: "user",
        toPath: "/user",
        icon: "",
    },
    {
        name: "菜单管理",
        code: "menu",
        toPath: "/menu",
        icon: "",
    }
]
const showMenuList = [
    {depId: '1', menuCodes: 'bigscreenData,waterYield,assay,examine,equipment,schedulePatrol,user,menu'},
    {depId: '2', menuCodes: 'waterYield,assay,equipment,schedulePatrol,user,menu'},
    {depId: '3', menuCodes: 'waterYield,assay,equipment,schedulePatrol,user,menu'},
    {depId: '4', menuCodes: 'waterYield,assay,equipment,schedulePatrol,user,menu'},
    {depId: '5', menuCodes: 'waterYield,assay,equipment,schedulePatrol,user,menu'},
    {depId: '6', menuCodes: 'waterYield,assay,equipment,schedulePatrol,user,menu'},
]
export function userMenuList(depId) {
    let currentMenuList = []
    let currentMenuCodeList = []
    showMenuList.forEach(item => {
        if(depId == item.depId) {
            currentMenuCodeList = item.menuCodes.split(',')
        }
    })
    console.log(currentMenuCodeList, 'currentMenuCodeList')
    menuList.forEach(item => {
        if(currentMenuCodeList.includes(item.code)) {
            currentMenuList.push(item)
        }
    })
    return {
        currentMenuList,
        currentMenuCodeList
    }
  }